require.sync('ShelvesEnum');
Ext.define('App.view.goods.GoodsList', {
	extend : 'App.config.BaseGrid',
    autoSizeXtype:"goodsList",
	xtype : 'goodsList',
	store : Ext.create('App.store.goods.GoodsStore',{
		groupField:"goodsType"
	}),
    features: [{
        groupHeaderTpl: Ext.create('Ext.XTemplate',
            '车型:',
            '<span>{name:this.formatName}</span>',
            {
                formatName: function (name) {
                    return name;
                }
            }
        ),
        ftype: 'groupingsummary'
    }],
	bbar : {
		xtype : 'pagingtoolbar',
		store : this.store,
		scrollable : true,
		displayInfo : true
	},
	columns : [ {
		xtype : 'rownumberer'
	},{
			text : '商品类型',
			dataIndex : 'goodsType',
        summaryRenderer: function (value) {
            return "合计";
        }
		},{
			text : '商品名',
			dataIndex : 'name'
		},{
			text : '价格',
			dataIndex : 'price',
            align:"end",
            renderer:function(value){
            return !value?0.00:NumberUtil.fmoney(value);
        }
		},{
			text : '积分',
			dataIndex : 'integral',
		    align:"end",
		},{
			text : '购买次数',
			dataIndex : 'number',
            summaryType: 'sum',
		    align:"end",
			renderer:function(value){
				return value;
			},
			summaryRenderer: function (value) {

				return value ;
			}
			},{
			text : '是否上架',
			dataIndex : 'isShelves',
			summaryType: 'count',
			renderer:function (value) {
				return ShelvesEnum.getHtml(value);
			},
			summaryRenderer: function (value) {

				return value ;
			}

    },]
});